﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using MentalAlchemy.Compounds.MachineLearning;

namespace MentalAlchemy.Molecules.NevaAlgorithm.compounds
{
	public partial class NevaPropertiesControl : UserControl
	{
		#region - Public properties. -
		public NevaParameters Parameters
		{
			get
			{
				var res = new NevaParameters();
				res.IndividualSize = 1;
				res.MRate = 0.01f;
				res.XRate = UseCrossingCheck.Checked? 0.7f : 0f;
				res.RNG = new Random();
				res.GeneValueRange = 0.2f;
				res.MinGeneValue = -0.1f;
				res.GenerationsNumber = (int)GenerationsNumeric.Value;
				res.PopulationSize = (int)PopSizeNumeric.Value;
				res.TournamentSize = (int)TournamentSizeNumeric.Value;
				res.UseElitism = ElitismCheck.Checked;
				res.NodesWindowSize = (int)NodeWindowNumeric.Value;
				res.NodesMutationLockTime = (int)NodeLockNumeric.Value;
				res.NodesMutationLockThreshold = (float)NodeThresholdNumeric.Value;

				res.UseAddSingleNode = AddSingleNodeCheck.Checked;
				res.UseParentChildCompetition = ParentChildCompeteCheck.Checked;

				return res;
			}
		}
		#endregion

		#region - Construction. -
		public NevaPropertiesControl()
		{
			InitializeComponent();
		} 
		#endregion
	}
}
